import java.time.Duration;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.*;
import java.util.stream.Collectors;

public class HelloWorld {
    public static void main(String[] args) throws InterruptedException {

//        Integer[] i1 = {1,2,3,4};
//        Integer[] i2 = {1,2,3,4,5};
//
//        Map<Integer, String> map = new HashMap<>();
//        map.put(5, "2");
//        map.put(1, "3");
//
//        Set<Integer> set1 = Arrays.stream(i1).collect(Collectors.toSet());
//        Set<Integer> set2 = Arrays.stream(i2).collect(Collectors.toSet());
//
////        set2.stream().filter(v -> !set1.contains(v)).forEach(v -> {
////            map.remove(v);
////        });
////
////        System.out.println(map);
//
//        Set<Map.Entry<Integer, String>> entries = map.entrySet();
//        Iterator<Map.Entry<Integer, String>> iterator = entries.iterator();
//
//        while (iterator.hasNext()) {
//            Map.Entry<Integer, String> next = iterator.next();
//            if (next.getKey() == 5) {
//                iterator.remove();
//            }
//        }
//
//        System.out.println(map);
        Map<String, Long> map = new HashMap<>();
        map.put("1", 1L);
        map.put("2", 2L);
        Long socketId  = 2L;
        map.entrySet().removeIf(next -> socketId.equals(next.getValue()));
        System.out.println(map);

    }
}
